
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpDicmngDicrecord.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpDicmngDicrecordForm"
 */
public class CcpDicmngDicrecordForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cddGuid = null;
   private java.lang.String _code = null;
   private java.lang.String _value = null;
   private java.lang.String _dicCode = null;
   private java.lang.String _cddOrder = null;

   /**
    * Standard constructor.
    */
   public CcpDicmngDicrecordForm() {
   }

   /**
    * Returns the cddGuid
    *
    * @return the cddGuid
    */
   public java.lang.String getCddGuid() {
      return _cddGuid;
   }

   /**
    * Sets the cddGuid
    *
    * @param cddGuid the new cddGuid value
    */
   public void setCddGuid(java.lang.String cddGuid) {
      _cddGuid = cddGuid;
   }
   /**
    * Returns the code
    *
    * @return the code
    */
   public java.lang.String getCode() {
      return _code;
   }

   /**
    * Sets the code
    *
    * @param code the new code value
    */
   public void setCode(java.lang.String code) {
      _code = code;
   }
   /**
    * Returns the value
    *
    * @return the value
    */
   public java.lang.String getValue() {
      return _value;
   }

   /**
    * Sets the value
    *
    * @param value the new value value
    */
   public void setValue(java.lang.String value) {
      _value = value;
   }
   /**
    * Returns the dicCode
    *
    * @return the dicCode
    */
   public java.lang.String getDicCode() {
      return _dicCode;
   }

   /**
    * Sets the dicCode
    *
    * @param dicCode the new dicCode value
    */
   public void setDicCode(java.lang.String dicCode) {
      _dicCode = dicCode;
   }
   /**
    * Returns the cddOrder
    *
    * @return the cddOrder
    */
   public java.lang.String getCddOrder() {
      return _cddOrder;
   }

   /**
    * Sets the cddOrder
    *
    * @param cddOrder the new cddOrder value
    */
   public void setCddOrder(java.lang.String cddOrder) {
      _cddOrder = cddOrder;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCddGuid() == null) {
         errors.add("cddGuid", new ActionError("error.cddGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
